package com.opal.jx.controller;

import com.opal.domain.R;
import com.opal.jx.entity.JxAssessReception;
import com.opal.jx.service.JxPBBService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 品保部
 */
@Controller
@RequestMapping("jx/pbb/")
public class JxPBBController {
    @Autowired
    private JxPBBService jxPBBService;

    /**
     * 从员工表中获取数据--初始化检验员和主管的表
     * @param jxAssessReception pkDept
     * @return
     */
    @RequestMapping("getTableDataByEmp")
    @ResponseBody
    public Object getTableDataByEmp(JxAssessReception jxAssessReception){
        return jxPBBService.getTableDataByEmp(jxAssessReception);
    }

    /**
     * 从品保部绩效表中获取数据--初始化检验员和主管的表
     * @param jxAssessReception   年、月
     * @return
     */
    @RequestMapping("getTableDataByJxAssessPbb")
    @ResponseBody
    public Object getTableDataByJxAssessPbb(JxAssessReception jxAssessReception){
        return jxPBBService.getTableDataByJxAssessPbb(jxAssessReception);
    }


    @RequestMapping("submitData")
    @ResponseBody
    public Object submitData(@RequestBody JxAssessReception jxAssessReception){
        R r=jxPBBService.insert(jxAssessReception);
        return r;
    }
}
